﻿<%@ Page Theme="BlueSkin" Title="Lms : My Family" Language="C#" MasterPageFile="~/LmsWebSite/MasterEN.master" AutoEventWireup="true" CodeFile="MyFamilyEN.aspx.cs" Inherits="MyFamilyEN" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .noheight
        {
            font-size:1px;
            height:1px;
            
        }
        
        .width10px
        {
            width:10px;
        }
        
        .containerDivMargins
        {
            margin: 0px 30px 0px 30px;
        }
    
    </style>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

 <asp:UpdatePanel ID="up1" runat="server" >
    <ContentTemplate>
        <asp:UpdateProgress ID="uprogress1" runat="server">
            <ProgressTemplate>
            
               <div style="position:fixed;width:30px;height:30px;top:0px;right:0px;border:1px solid orange;">
                    <img src="images/loading.gif" style="width:30px;height:30px;"  alt='Loading' title='Loading'/>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    
        
<table cellspacing="5" cellpadding="5" width="100%">
        <tr>
            <td align="left" class="heading">
                <div class="floating">
                My Family
                </div>
                
                <div class="clearing"></div>
            </td>
            
                
           
        </tr>



         <tr>
                        <td class="aligning">
                           

                            
                                            <p style="text-align:justify;margin-right:5px;margin-left:5px;color:Red;font-weight:bold;">
                                                Email of all family members must be registered to be able retrieving thier passwords in case of loss.
                                            </p>
                                            


                        </td>
                  </tr>

    </table>
    <br />
   
    <div class="aligning allWidthWithMargins  direction" style="margin:0px 30px 30px 30px;">
        <asp:GridView ID="grdCourses" runat="server" AutoGenerateColumns="False"  DataKeyNames="GenID"
            Font-size="12px"  EnableModelValidation="True"   
            Width="840px"  
            onrowediting="grdCourses_RowEditing"  DataSourceID="odsPersons" 
            onrowupdating="grdCourses_RowUpdating">
            
            <HeaderStyle HorizontalAlign="Center" />
            <RowStyle HorizontalAlign="Center" />


            <EmptyDataTemplate>
                <div class="aligning floating direction" style="width:840px;">
                    <asp:Label ID="Label2" runat="server" Text="Label" >No Family</asp:Label> 
                    <br />
                    <br />
                    
                </div>
                    
                </EmptyDataTemplate>


            <Columns>
            
                

                <asp:TemplateField HeaderText="Name">
                    <ItemTemplate>
                        <%# ((DatabaseComponent.Persons)Container.DataItem).getFullNameAR() + " " + ((DatabaseComponent.Persons)Container.DataItem).getFullName() %>
                    </ItemTemplate>
                </asp:TemplateField>


                <asp:TemplateField HeaderText="Username">
                
                    <ItemTemplate>
                        <%# ((DatabaseComponent.Persons)Container.DataItem).ID %>
                    </ItemTemplate>
                
                </asp:TemplateField>
                
                
                <asp:TemplateField HeaderText="Email">
                
                    <ItemTemplate>
                        <%# ((DatabaseComponent.Persons)Container.DataItem).Email %>
                    </ItemTemplate>

                    <EditItemTemplate>
                        <asp:TextBox ID="txtMail" runat="server" Text='<%# ((DatabaseComponent.Persons)Container.DataItem).Email %>' Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvMail" runat="server" ErrorMessage="You must enter an email address" ControlToValidate="txtMail">*</asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator
                            ID="revMail" runat="server" 
                            ErrorMessage="Email must be in the correct form" 
                            ControlToValidate="txtMail" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                    </EditItemTemplate>
                
                    
                    


                </asp:TemplateField>


                <asp:TemplateField HeaderText="Default Password">
                    <ItemTemplate>1234</ItemTemplate>
                </asp:TemplateField>


                
               <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton runat="server" ID="lnkEdit" CommandName="Edit" CommandArgument='<%# Container.DataItemIndex %>' CausesValidation="false">Edit</asp:LinkButton>
                </ItemTemplate>


                <EditItemTemplate>
                    <asp:LinkButton runat="server" ID="lnkSave" CommandName="Update" CommandArgument='<%# Container.DataItemIndex %>' CausesValidation="true">Save</asp:LinkButton>
                    <asp:LinkButton runat="server" ID="lnkCancel" CommandName="Cancel" CommandArgument='<%# Container.DataItemIndex %>' CausesValidation="false">Cancel</asp:LinkButton>
                </EditItemTemplate>
                
               </asp:TemplateField>


                
            </Columns>
            <HeaderStyle BackColor="Tan" Font-Bold="True" />
        </asp:GridView>


    </div>
    <div class="clearing" style="height:5px;"></div>

                <div class="containerDivMargins">
                    <asp:ValidationSummary ID="vsResult" runat="server" ShowSummary="false" ShowMessageBox="true" />
                </div>
                
        

    <div class="clearing" style="height:5px;"></div>
    </ContentTemplate>
    </asp:UpdatePanel>
    
<asp:ObjectDataSource ID="odsPersons" runat="server" 
        onselecting="odsPersons_Selecting" SelectMethod="Select" 
        TypeName="DatabaseComponent.PersonsDB" 
        >
    <SelectParameters>
        <asp:Parameter Name="con" Type="Object" />
        <asp:Parameter Name="strTop" Type="String" DefaultValue="" />
        <asp:Parameter Name="strWhere" Type="String" />
        <asp:Parameter Name="whereParams" Type="Object" />
    </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

